Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




Secondary Name Node

hadoop_secondary_name_node

We have seen the Name Node is used to hold the information about the details of the data blocks stored in the Data Nodes. But what if the Name Node fails?

As a workaround there is something called 'Secondary Name Node'. The 'Name Node' and 'Secondary Name Node' works hand in hand so that if the 'Name Node' is down the 'Secondary Name Node' can fill the gap.

So, let's see the components fsimage and Edits in detail.



fsimage : It contains all the modification that were done in the Data Node from the time the Name Node had started. Since the file is large and contains a lot of data, it is stored in the disk.

edits : It contains the most recent modification done to the Data Nodes. Since, this file contains less data, it is stored in the memory(i.e. RAM) of the Name Node.


Note : Remember the Name Node and the Secondary Name Nodes are standalone machines.


How data transfer happens from Name Node and Secondary Name Node?

At first the 'fsimage' and the 'edit logs' is copied from Name Node to Secondary Name Node. Then in the Secondary Name Node, the 'fsimage' and the 'edit logs' are combined to get the 'final fsimage'. Which is then copied back to the 'Name Node' and replaced with the 'Name Node' of the 'Name Node'.